/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package bean;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mezouari
 */
@Entity
@Table(name = "chauffeur")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Chauffeur.findAll", query = "SELECT c FROM Chauffeur c"),
    @NamedQuery(name = "Chauffeur.findById", query = "SELECT c FROM Chauffeur c WHERE c.id = :id"),
    @NamedQuery(name = "Chauffeur.findByCin", query = "SELECT c FROM Chauffeur c WHERE c.cin = :cin"),
    @NamedQuery(name = "Chauffeur.findByNom", query = "SELECT c FROM Chauffeur c WHERE c.nom = :nom"),
    @NamedQuery(name = "Chauffeur.findByPrenom", query = "SELECT c FROM Chauffeur c WHERE c.prenom = :prenom"),
    @NamedQuery(name = "Chauffeur.findByDateNaissance", query = "SELECT c FROM Chauffeur c WHERE c.dateNaissance = :dateNaissance"),
    @NamedQuery(name = "Chauffeur.findByTelephone", query = "SELECT c FROM Chauffeur c WHERE c.telephone = :telephone"),
    @NamedQuery(name = "Chauffeur.findByEmail", query = "SELECT c FROM Chauffeur c WHERE c.email = :email"),
    @NamedQuery(name = "Chauffeur.findByPassword", query = "SELECT c FROM Chauffeur c WHERE c.password = :password"),
    @NamedQuery(name = "Chauffeur.findByNumPermis", query = "SELECT c FROM Chauffeur c WHERE c.numPermis = :numPermis"),
    @NamedQuery(name = "Chauffeur.findByCategorie", query = "SELECT c FROM Chauffeur c WHERE c.categorie = :categorie"),
    @NamedQuery(name = "Chauffeur.findByNumCnss", query = "SELECT c FROM Chauffeur c WHERE c.numCnss = :numCnss"),
    @NamedQuery(name = "Chauffeur.findByChiffrage", query = "SELECT c FROM Chauffeur c WHERE c.chiffrage = :chiffrage")})
public class Chauffeur implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Cin")
    private String cin;
    @Basic(optional = false)
    @Column(name = "Nom")
    private String nom;
    @Basic(optional = false)
    @Column(name = "Prenom")
    private String prenom;
    @Basic(optional = false)
    @Column(name = "DateNaissance")
    @Temporal(TemporalType.DATE)
    private Date dateNaissance;
    @Basic(optional = false)
    @Column(name = "Telephone")
    private String telephone;
    @Basic(optional = false)
    @Column(name = "Email")
    private String email;
    @Basic(optional = false)
    @Column(name = "Password")
    private String password;
    @Basic(optional = false)
    @Column(name = "NumPermis")
    private String numPermis;
    @Basic(optional = false)
    @Column(name = "Categorie")
    private String categorie;
    @Basic(optional = false)
    @Column(name = "NumCnss")
    private String numCnss;
    @Basic(optional = false)
    @Column(name = "Chiffrage")
    private String chiffrage;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idChauffeur")
    private List<Reservation> reservationList;

    public Chauffeur() {
    }

    public Chauffeur(Integer id) {
        this.id = id;
    }

    public Chauffeur(Integer id, String cin, String nom, String prenom, Date dateNaissance, String telephone, String email, String password, String numPermis, String categorie, String numCnss, String chiffrage) {
        this.id = id;
        this.cin = cin;
        this.nom = nom;
        this.prenom = prenom;
        this.dateNaissance = dateNaissance;
        this.telephone = telephone;
        this.email = email;
        this.password = password;
        this.numPermis = numPermis;
        this.categorie = categorie;
        this.numCnss = numCnss;
        this.chiffrage = chiffrage;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCin() {
        return cin;
    }

    public void setCin(String cin) {
        this.cin = cin;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public Date getDateNaissance() {
        return dateNaissance;
    }

    public void setDateNaissance(Date dateNaissance) {
        this.dateNaissance = dateNaissance;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNumPermis() {
        return numPermis;
    }

    public void setNumPermis(String numPermis) {
        this.numPermis = numPermis;
    }

    public String getCategorie() {
        return categorie;
    }

    public void setCategorie(String categorie) {
        this.categorie = categorie;
    }

    public String getNumCnss() {
        return numCnss;
    }

    public void setNumCnss(String numCnss) {
        this.numCnss = numCnss;
    }

    public String getChiffrage() {
        return chiffrage;
    }

    public void setChiffrage(String chiffrage) {
        this.chiffrage = chiffrage;
    }

    @XmlTransient
    public List<Reservation> getReservationList() {
        return reservationList;
    }

    public void setReservationList(List<Reservation> reservationList) {
        this.reservationList = reservationList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Chauffeur)) {
            return false;
        }
        Chauffeur other = (Chauffeur) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.Chauffeur[ id=" + id + " ]";
    }
    
}
